home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Enlighten DSM 1.1
/
SGI EnlightenDSM 1.1.iso
/
sunos41x
/
events.z
/
events
/
policy
/
archive.sh
next >
Wrap
Linux/UNIX/POSIX Shell Script
|
1998-06-30
|
899b
|
33 lines
#!/bin/sh
#
# Copyright (c) 1990-1998 Enlighten Software Solutions, Inc.
#
# Example of automatically archiving files that get too big.
# 1. edit testtab (or select SNMP limits group) and :
# set: +jump=1
# set: notify=/path/to/example.sh
#
# DISCLAIMER :
# THIS PROGRAM IS ONLY AN EXAMPLE. IT IS UNSUPPORTED AND NOT INTENDED
# FOR ACTUAL USE. IF YOU DECIDE YOU MAY WANT TO EXECUTE THIS PROGRAM,
# YOU ARE STRONGLY URGED TO FIRST VERIFY IT'S SUITABLITY AND BEHAVIOR.
#
# USE: This is an example of how you may wish to manage files that grow
# without bound.
#
# TESTNAME=$1
# VALUE=$2
# UNITS=$3
# ALARM=$4
# TIME=$5
MO=`date | cut -d" " -f2` # form a month-yr file extention
YR=`date | cut -d" " -f7`
F=tmp$$
mv $1 $F # safety first!
cat $F >> $1.$MO$YR # create/append archive
rm $F # rid old file
# DONE